<% content_for :sitemap do %>
  <span class="current"><%= t("admin.menu.nodes")%></span>
<% end %>
<div class="toolbar">
  <%= link_to t("admin.nodes.new"), new_admin_node_path, class: "btn btn-secondary" %>
</div>
<table class="table table-bordered table-striped table-condensed">
  <tr class="head">
    <th class="first">#</th>
    <th>Name</th>
    <th>Order</th>
    <th>Topics Count</th>
    <th></th>
  </tr>
  <% @nodes.each do |node| %>
    <tr>
      <td class="first"><%= node.id %></td>
      <td><%= link_to node.name, node_topics_path(node.id) %></td>
      <td><%= node.sort %></td>
      <td><%= node.topics_count %></td>
      <td class="actions">
        <div class="btn-group">
          <%= link_to icon_tag("edit"), edit_admin_node_path(node), class: "btn" %>
          <%= link_to icon_tag("trash"), admin_node_path(node), 'data-confirm' => 'Are you sure?' , method: :delete, class: "btn" %>
        </div>
      </td>
    </tr>
  <% end %>
</table>
